<template>
  <el-dialog v-model="TModel" title="Tips" width="30%" align-center destroy-on-close draggable>
    <slot></slot>
    <template #footer>
      <slot name="footer" v-if="$slots.footer"></slot>
      <span class="dialog-footer" v-else>
        <el-button @click="close">Cancel</el-button>
        <el-button type="primary" @click="submit">Submit</el-button>
      </span>
    </template>
  </el-dialog>
</template>
<script lang="ts" setup name="T_DiaLog">
const props = defineProps({
  model: {
    type: Boolean,
    default: false
  }
})
const emits = defineEmits(['close', 'submit', 'update:model'])
const TModel = computed({
  get: () => props.model,
  set: val => {
    emits('update:model', val)
  }
})
const close = () => {
  emits('close')
  emits('update:model', false)
}
const submit = () => {
  emits('submit')
  emits('update:model', false)
}
</script>
<style lang="scss"></style>
